﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta charset="utf-8">
		<title>
			题材龙头明细
		</title>
		
		<style>
			@charset "UTF-8";body,html{-moz-user-select:none;-khtml-user-select:none;user-select:none;width:100%;height:100%}*{margin:0;padding:0}body{list-style:none;font:15px
			'Microsoft YaHei',微软雅黑,tahoma,arial,Helvetica,sans-serif;font-weight:400;line-height:1.5;overflow:hidden}.center,.top{left:0;position:absolute}.top{width:100%;height:240px;top:0}.center{height:24px;top:240px;padding:0
			28px 0 20px}.center table th{text-align:right}.bottom,.bottom .left{position:absolute;bottom:0}.bottom{width:100%;top:264px;left:0}.bottom
			.left{left:10px;right:18px;top:0;z-index:2;overflow:hidden;padding:0 10px}.bottom
			.left tr.stockinfo td{height:24px;text-align:right;line-height:24px}.bottom
			.left tr.stockinfo td:nth-child(2){padding-left:20px}.bottom .left table
			thead th{padding:0;border-width:0;height:0}.bottom .left .first tr:nth-child(1)
			td:nth-child(1){border-width:0}.bottom .left .line{position:absolute;z-index:-1;width:1px;left:0;top:9px;height:24px}.bottom
			.left tr td:nth-child(1){border-width:0 0 0 1px;border-left-style:solid}.bottom
			.right{position:absolute;right:0;width:18px;top:0;bottom:0}.loading{position:absolute;z-index:999;top:60px;height:60px;line-height:60px;left:0;text-align:center;width:100%}.rq{position:relative;height:32px;line-height:32px}.rq
			.cicle{position:absolute;left:-6px;top:9px;width:10px;height:10px;border-radius:5px}.loadingimage{background-image:none!important}.txblack
			body{background-color:#000;color:#a1a1a1}.txblack .iScrollIndicator{background-color:#000;border:1px
			solid #414141}.txblack .loading{background:url()
			no-repeat center center}.txblack .color-up{color:#f33}.txblack .color-down{color:#0bab5b}.txblack
			.rq .cicle,.txwhite .rq .cicle{background-color:#fba710}.txblack .select{background-color:#202020}.txblack
			.bottom .left tr td:nth-child(1),.txwhite .bottom .left tr td:nth-child(1){border-left-color:#bcbcbc}.txblack
			.bottom .left td{color:#fff}.txblack .bottom .left td.title{color:#8f8f8f}.txblack
			.bottom .left td.hqcode{color:#ffe98f}.txblack .bottom .left .line,.txwhite
			.bottom .left .line{background:#bcbcbc}.txwhite body{background-color:#fff;color:#333}.txwhite
			.iScrollIndicator{background-color:#fff;border:1px solid #efefef}.txwhite
			.loading{background:url()
			no-repeat center center}.txwhite .color-up{color:#f33}.txwhite .color-down{color:#0bab5b}.txwhite
			.bottom .left td.hqcode{color:#c09b00}
		</style>
		<script>
			var JsUrl = {};
			! function() {
				document.documentElement.focus();
				var t = window.location.search.substring(1);				
				if (void 0 !== t)
					for (var l = t.split("&"), e = 0; e < l.length; e++) JsUrl[l[e].split("=")[0]] = l[e].split("=")[1];
				"0" == JsUrl.color ? JsUrl.style = "black" : JsUrl.style = "white", "white" == JsUrl.style ? document.getElementsByTagName("html")[0].setAttribute("class", "txwhite") : document.getElementsByTagName("html")[0].setAttribute("class", "txblack"), JsUrl.dirhtml = "http://page.tdx.com.cn:7615/site/pcwebcall/html/"
			}()			
		</script>
		
	</head>
	<body onselectstart="return!1">
		<script>
			void 0 !== JsUrl.bkcolor && "-1" == JsUrl.bkcolor.indexOf("tdxbkcolor") && "0" == JsUrl.color && (document.getElementsByTagName("body")[0].style.background = "#" + JsUrl.bkcolor)
		</script>		
		<div class="top" id="top" >			
		</div>
		<div class="center" id="center" >			
			<table style="width:100%;border-collapse:collapse;table-layout:fixed"
			border="0" cellspacing="0" cellpadding="0">
				<thead>
					<tr>
						<th width="20">&nbsp </th>
						<th width="100">涨停时间</th>
						<th width="80">代码</th>
						<th width="80">名称</th>
						<th width="80">现价</th>
						<th width="80">涨幅</th>
						<th width="36%">封单额</th>
						<th width="28%">封成比</th>
						<th width="36%">几天几板</th>
					</tr>
				</thead>
			</table>
		</div>
		<div class="bottom" id="bottom">
			<div class="left" id="left">
				<div class="scrollBox" id="scrollBox">
				</div>
			</div>
			<div class="right" id="right">
			</div>
		</div>
		<div class="loading" id="loading">
		</div>
		<script src="http://page.tdx.com.cn:7615/site/lib/jquery.min.js">
		</script>
		<script src="http://page.tdx.com.cn:7615/site/lib/echarts.min.js">
		</script>
		<script src="http://page.tdx.com.cn:7615/site/pcwebcall/mylib/echartcolor.js">
		</script>
		<script src="http://page.tdx.com.cn:7615/site/pcwebcall/mylib/tscroll.js">
		</script>
		<script src="http://page.tdx.com.cn:7615/site/pcwebcall/mylib/dataFormat.js">
		</script>
		<!-- <script src="http://page.tdx.com.cn:7615/site/lib/connect/req.js"> -->
		<!-- <script src="req.js"> -->
		<!-- </script> -->
		<script>
			"use strict";
			var glob = {
				loadstate: 0,
				lastrq: "",
				page: 1,
				recid: {},
				waitstate: 1,
				hqstock: {},
				hqinfo: {},
				rowindex: 0,
				currowindex: -1,
				prerowindex: -1,
				columns: [{
					field: "T006",
					title: "涨停时间"
				}, {
					field: "code",
					title: "代码"
				}, {
					field: "name",
					title: "名称"
				}, {
					field: "xj",
					title: "现价"
				}, {
					field: "zf",
					title: "涨幅"
				}, {
					field: "T005",
					dataType: 10,
					title: "封单额"
				}, {
					field: "T018",
					dataType: 2,
					title: "封成比"
				}, {
					field: "lbxx",
					dataType: 0,
					title: "几天几板"
				}],
				tdObj: {}
			};

			function updategrid(t) {
				if (-1 != (t = fnRst(t)) && -2 != t && 0 != t.length && 0 != t[0].rows.length) {
					var e = 0;
					if (2 == t.length && (e = t[1].rows[0].cnt), 1 == glob.page && 1 == e)
						for (var o = 0; o < t[0].rows.length; o++) t[0].rows[o].cnt = 1;
					transR(t[0].rows), glob.page += 1, glob.page % 2 == 0 ? queryLoad() : glob.loadstate = 1
				}
			}

			function queryLoad() {
				JsUrl.ztbkcode ? CallTQL(updategrid, "pcwebcall_tclt_ztmx", ["8", JsUrl.ztbkcode, glob.page + ""], {
					reqtype: "cwserv"
				}) : CallTQL(updategrid, "pcwebcall_tclt_ztmx", ["2", JsUrl.ztid, glob.page + ""], {
					reqtype: "cwserv"
				})
			}

			function transR(t) {
				for (var e = [], o = {}, l = 0; l < t.length; l++) {
					var r = t[l].rq + t[l].code;
					glob.recid[r] || (-1 == $.inArray(t[l].rq, e) && (e.push(t[l].rq), o[t[l].rq] = []), o[t[l].rq].push(t[l])), glob.hqstock[t[l].code] = {
						code: t[l].code,
						sc: t[l].sc
					}
				}
				if (e.length)
					if ("1" != glob.page) {
						if (e[0] == glob.lastrq) return glob.lastrq = e[e.length - 1], void createD(e, o, 1);
						glob.lastrq = e[e.length - 1], createD(e, o, 0)
					} else glob.lastrq = e[e.length - 1], createD(e, o, 0)
			}

			function createD(t, e, o) {
				var l = "",
					r = "",
					a = glob.columns.length;
				"1" == glob.page && (r = "first");
				for (var i = ['<table class="' + r + '" style="width:100%;border-collapse: collapse;table-layout: fixed;"  border="0" cellspacing="0" cellpadding="0">'], n = ['<thead> <tr><th  width="20"></th>'], s = 0; s < a; s++) 0 == s ? n.push('<th  width="100"></th>') : 1 == s || 2 == s || 3 == s || 4 == s ? n.push('<th  width="80"></th>') : 5 == s || 7 == s ? n.push('<th  width="36%"></th>') : n.push('<th  width="28%"></th>');
				i.push(n.join("")), i.push("</thead><tbody>");
				for (var d = [], c = 0; c < t.length; c++) {
					l = "1" == glob.page && 0 == c ? '<div class="line"></div>' : "", 0 == c && 0 != o || (i.push("<tr>"), i.push('<td class="rq" width="20" >' + l + '<div class="cicle"></div></td><td  class="title" colspan="' + a + '">' + t[c] + "</td>"), i.push("</tr>"));
					for (var h = e[t[c]], g = 0; g < h.length; g++) {
						i.push('<tr rowindex="' + glob.rowindex + '" id="row-index-' + glob.rowindex + '"  class=" stockinfo" sc="' + h[g].sc + '" code="' + h[g].code + '">'), glob.rowindex += 1, i.push('<td width="20">&nbsp</td>');
						var f = glob.hqinfo[h[g].code];
						f || d.push({
							code: h[g].code,
							sc: h[g].sc
						});
						for (var u = 0; u < a; u++) {
							var b = glob.columns[u].field;
							"xj" == b || "zf" == b ? f ? "xj" == b ? i.push('<td style="text-align: right" field="' + b + '">' + fmtZdf(f.now, f.zdf) + "</td>") : i.push('<td style="text-align: right" field="' + b + '">' + dataFormat.baseZdf(f.zdf, "%") + "</td>") : i.push('<td style="text-align: right" field="' + b + '">--</td>') : "T006" == b ? i.push('<td style="text-align: right"  field="' + b + '">' + glob.columns[u].formatterSelf(h[g][b]) + "</td>") : "code" == b || "name" == b ? i.push('<td class="hqcode" style="text-align: right"  field="' + b + '">' + glob.columns[u].formatterSelf(h[g][b]) + "</td>") : "ltsz" == b && "1" == h[g].cnt ? i.push('<td id="ltsz' + h[g].code + '" style="text-align: right"  field="' + b + '">' + glob.columns[u].formatterSelf(h[g][b]) + "</td>") : i.push('<td style="text-align: right"  field="' + b + '">' + glob.columns[u].formatterSelf(h[g][b]) + "</td>")
						}
						i.push("</tr>")
					}
				}
				i.push("</tbody></table>");
				var p = $(i.join("")).appendTo($("#scrollBox"));
				glob.TScroll && glob.TScroll.refresh(), setTimeout(function() {
					var t = p.children("tbody").children("tr");
					if (t.click(function() {
						if ($(this).hasClass("stockinfo")) {
							if ($(this).hasClass("select")) return;
							var t = $(this).attr("rowindex");
							$(this).addClass("select");
							var e = glob.prerowindex,
								o = $(this).attr("code"),
								l = $(this).attr("sc");
							"-1" != e && $("#row-index-" + glob.prerowindex).removeClass("select"), glob.prerowindex = t, glob.currowindex = t, jumpHQ(l, o)
						}
					}), t.each(function() {
						var t = $(this),
							e = t.attr("code");
						if (e) {
							glob.tdObj[e] || (glob.tdObj[e] = []);
							var o = {};
							t.children("td").each(function() {
								var t = $(this).attr("field");
								"xj" != t && "zf" != t || (o[t] = $(this))
							}), glob.tdObj[e].push(o)
						}
					}), d.length) var e = setInterval(function() {
						1 == glob.waitstate && (glob.waitstate = 0, serverhq(d, function(t) {
							for (var e in t) glob.hqinfo[e] = t[e], updateHq(e)
						}), clearInterval(e), e = null)
					}, 100)
				}, 40)
			}

			function fnRst(t) {			
				try {
					t = FormatResult(t, 1)
				} catch (t) {
					return -1
				}
				return 0 != t.ErrorCode ? "timeout" == t.ErrorInfo ? -2 : -1 : (null == t.tables && (t.tables = []), t.tables)
			}

			function serverhq(t, e) {
				for (var o = [], l = 0; l < t.length; l++) o.push(t[l]);
				var r = {},
					a = glob.reqid;
				! function t() {
					var l = 90;
					window.TDXQuery || (l = 60);
					var i = o.splice(0, l),
						n = [];
					if ($.each(i, function(t, e) {
						n.push(e.sc + e.code)
					}), window.TDXQuery) window.TDXQuery({
						request: JSON.stringify({
							Method: "ASK_HQSimData",
							FuncName: "",
							Param: "12|" + n.join("|")
						}),
						onSuccess: function(l) {
							var i = null;
							try {
								i = $.parseJSON(l), $.each(i, function(t, e) {
									var o, l = dataFormat.fmtFlt(e.NOW),
										a = dataFormat.fmtFlt(e.CLOSE);
									o = 0 == l || 0 == a ? 0 : 100 * (l - a) / a, r[e.CODE] = {
										sc: e.MARKET,
										now: l,
										zdf: o
									}
								})
							} catch (l) {}
							a == glob.reqid ? o.length ? t() : (glob.waitstate = 1, e(r)) : glob.waitstate = 1
						},
						onFailure: function(l, i) {
							a == glob.reqid ? o.length ? t() : (glob.waitstate = 1, e(r)) : glob.waitstate = 1
						}
					});
					else {
						for (var s = "", d = 0; d < i.length; d++) 0 != s.length && (s += ","), s += '{"Code":' + i[d].code + ',"Setcode":' + i[d].sc + "}";
						CallTQL(function(l) {
							var i = null;
							try {
								i = $.parseJSON(l)
							} catch (l) {}
							if (i && i.List)
								for (var n = i.ListHead, s = i.List, d = 0; d < s.length; d++) {
									for (var c = {}, h = 0; h < n.length; h++) c[n[h]] = s[d][h];
									var g, f = dataFormat.fmtFlt(c.NOW),
										u = dataFormat.fmtFlt(c.CLOSE);
									g = 0 == f || 0 == u ? 0 : 100 * (f - u) / u, r[c.Code] = {
										sc: c.Setcode,
										now: f,
										zdf: g
									}
								}
							a == glob.reqid ? o.length ? t() : (glob.waitstate = 1, e(r)) : glob.waitstate = 1
						}, "HQServ.CombHQ", '{"WantCol":["ACTIVECAPITAL","CLOSE","NOW"],"Secu":[' + s + "]}")
					}
				}()
			}

			function fmtZdf(t, e) {
				return e = dataFormat.fmtFlt(e), t = dataFormat.fmtFlt(t), isNaN(t) ? "--" : 0 < e ? '<span class="color-up">' + t.toFixed(2) + "</span>" : e < 0 ? '<span class="color-down">' + t.toFixed(2) + "</span>" : t.toFixed(2)
			}

			function jumpHQ(t, e) {			
				window.open("http://www.treeid/breed_" + t + e, "_parent")
			}

			function updateHq(t) {
				var e = glob.hqinfo[t],
					o = glob.tdObj[t];
				if (o.length)
					for (var l = 0; l < o.length; l++) o[l].xj.html(fmtZdf(e.now, e.zdf)), o[l].zf.html(dataFormat.baseZdf(e.zdf, "%"))
			}
			
			$(function() {
				for (var t = 0; t < glob.columns.length; t++) glob.columns[t].formatter || (glob.columns[t].formatterSelf = dataFormat.getDefaultFunc(glob.columns[t].dataType || "0", glob.columns[t].fmtParam));
				glob.TScroll = new Tscroll($("#left")[0], {
					useTransform: !0,
					scrollX: !1,
					scrollY: $("#left")[0],
					width: 10,
					right: 2,
					scrollBoxY: $("#right")[0]
				});
				var e = echarts.init($("#top")[0]);
				glob.TScroll.on("scroll", function() {
					1 == glob.loadstate && (glob.loadstate = 0, queryLoad())
				}), $(window).resize(function() {
					e.resize()
				});
				var o = "4",
					l = JsUrl.ztid;
				JsUrl.ztbkcode && (o = "7", l = JsUrl.ztbkcode), CallTQL(function(t) {				
					if (-1 != (t = fnRst(t)) && -2 != t && 0 != t.length && 0 != t[0].rows.length) {
						$("#loading").hide();
						for (var o = [], l = [], r = 0; r < t[0].rows.length; r++) o.push(t[0].rows[r].rq), l.push(dataFormat.fmtFlt(t[0].rows[r].cnt));
						var a = getChartColor({
							title: {
								show: !0,
								text: "历史涨停轨迹",
								left: "center",
								top: 10
							},
							tooltip: {
								show: !0,
								trigger: "axis",
								showContent: !0,
								confine: !0,
								borderWidth: 1,
								textStyle: {
									lineHeight: 18,
									fontSize: 12
								},
								axisPointer: {
									label: {},
									lineStyle: {
										width: 0
									}
								}
							},
							grid: {
								top: 40,
								left: 40,
								right: 40,
								bottom: 40
							},
							legend: {
								right: 20,
								show: !0,
								top: 10,
								data: [{
									name: "涨停家数",
									icon: "none"
								}],
								selectedMode: !1
							},
							xAxis: {
								data: o,
								inverse: !0,
								show: !0,
								gridIndex: 0,
								position: "bottom",
								type: "category",
								nameLocation: "center"
							},
							yAxis: {
								show: !0,
								gridIndex: 0,
								type: "value",
								name: "",
								axisLabel: {
									show: !0
								},
								nameLocation: "end"
							},
							color: ["#C48026"],
							animation: !0,
							series: [{
								name: "涨停家数",
								data: l,
								lineStyle: {
									normal: {
										width: 2,
										color: "#FBA710"
									}
								},
								showSymbol: !1,
								type: "line"
							}]
						}, JsUrl.style);
						e.setOption(a)
					} else $("#loading").addClass("loadingimage").show().text("无涨停数据")
				}, "pcwebcall_tclt_ztmx", [o, l, ""], {
					reqtype: "cwserv"
				}), setInterval(function() {
					var t = [];
					for (var e in glob.hqstock) t.push(glob.hqstock[e]);
					1 == glob.waitstate && serverhq(t, function(t) {
						for (var e in t) glob.hqinfo[e] = t[e], updateHq(e)
					})
				}, 8e3), queryLoad()
				hide();				
			});
			var fmtTen = dataFormat.getDefaultFunc(10);
			
			//reg.js
			var CALLTQL_CONFIG = {
				url: 'http://page.tdx.com.cn:7615/',
				dataType: 'text',
				type: 'POST',
				callType: 'external',
				timeout: 20000,
				CilentSpecifiedKey: ''
			};	

			function CallTQL(m, j, d, c) {
				c = c == undefined ? {} : c;
				var g = $.extend(true, {}, CALLTQL_CONFIG);
				if (c != undefined && c != '' && c != null) {
					$.each(c, function(e, n) {
						g[e] = n;
					});
				}
				var a = Fun_Name(m);
				var f = 'CWServ.SecuInfo';
				if (typeof d == 'string') {
					f = j;
				} else {
					if (j) {
						if (
							j.substring(0, 10).toUpperCase() == 'SKEF10_HK_' ||
							j.substring(0, 10).toUpperCase() == 'SKEF10_MG_' ||
							j.substring(0, 6).toUpperCase() == 'TDXSJ_' ||
							j.substring(0, 7).toUpperCase() == 'TDXF10_' ||
							j.substring(0, 8).toUpperCase() == 'TDXBF10_' ||
							j.substring(0, 10).toUpperCase() == 'PCWEBCALL_'
						) {
							g.reqtype = 'cwserv';
						}
					}
					if (g.hasOwnProperty('reqtype') && g.reqtype == 'cwserv') {
						f = 'CWServ.' + j;
						d = FormatParams(d);
						d = '{' + d;
						if (g.CilentSpecifiedKey) {
							d += ',"CilentSpecifiedKey":"' + g.CilentSpecifiedKey + '"';
						}
						if (g.secuparse == 'true') {
							d += ',"secuparse":"true"';
						}
						d += '}';
					} else {
						d = FormatParams(d);
						d = '{"CallName":"' + j + '",' + d;
						if (g.CilentSpecifiedKey) {
							d += ',"CilentSpecifiedKey":"' + g.CilentSpecifiedKey + '"';
						}
						if (g.secuparse == 'true') {
							d += ',"secuparse":"true"';
						}
						d += '}';
					}
				}				
													
				var b = (c || {})['callFunc'];
				if (b) {
					f = b;
				}				
				$.ajax({
					url: g.url + 'TQLEX?Entry=' + f,
					type: g.type,
					dataType: g.dataType,
					data: d,
					jsonp: 'callback',
					timeout: g.timeout,
					success: function(e) {
						m(e);
					},
					error: function(o, e, n) {
						if (e == 'timeout') {
							m('{"ErrorCode":1, "ErrorInfo":"timeout"}');
						} else {
							m('{"ErrorCode":1, "ErrorInfo":"error"}');
						}
					}
				});					
			}

			function Fun_Name(a) {
				var b = a.toString();
				var c = /function\s*(\w*)/i;
				var d = c.exec(b);
				return d[1];
			}

			function FormatParams(d) {
				var c = '';
				c += '"Params":[';
				var b = '';
				for (var a = 0; a < d.length; a++) {
					if (typeof d[a] == 'string') {
						b += ',"' + d[a] + '"';
					} else {
						if (typeof d[a] == 'number') {
							b += ',' + d[a];
						} else {
							alert('非法的参数！');
							break;
						}
					}
				}
				if (b != '') {
					b = b.substr(1);
				}
				c += b;
				c += ']';
				return c;
			}

			function FormatResult(f) {
				try {					
					var l = $.parseJSON(f);
				} catch (h) {}
				var m = {};
				m.ErrorCode = l.ErrorCode;
				if (m.ErrorCode != 0) {
					m.ErrorInfo = l.ErrorInfo;
					return m;
				}
				m.CilentSpecifiedKey = l.CilentSpecifiedKey;
				m.tables = [];
				for (var g = 0; g < l.ResultSets.length; g++) {
					var a = [];
					if (typeof l.ResultSets[g].ColName !== 'undefined') {
						for (var c = 0; c < l.ResultSets[g].ColName.length; c++) {
							a.push({
								Name: l.ResultSets[g].ColName[c]
							});
						}
					} else {
						a = l.ResultSets[g].ColDes;
					}
					if (a[0].Name == 'total') {
						if (g - 1 >= 0) {
							m.tables[g - 1].total = l.ResultSets[g].Content[0][0];
						}
					}
					m.tables[g] = {};
					m.tables[g].total = '';
					m.tables[g].rows = [];
					var n = l.ResultSets[g].Content;
					for (var c = 0; c < n.length; c++) {
						m.tables[g].rows[c] = {};
						for (var b = 0; b < a.length; b++) {
							m.tables[g].rows[c][a[b].Name] = n[c][b];
						}
					}
				}
				return m;
			}
					
			function hide() {				
				var p = window.parent.t;//调取父窗口变量				
				<!-- $("#top").attr("style","display:none;"); -->
				<!-- $("#center").attr("style","top:30px;"); -->
				<!-- $("#bottom").attr("style","top:55px;"); -->
				var obj1 = document.getElementById("top");													
				var obj2 = document.getElementById("center");				
				var obj3 = document.getElementById("bottom");				
				if(p == 0){						
					obj1.style.display = "none";					
					obj2.style.top= "30px";
					obj3.style.top= "55px"; 										
				}else{						
					obj1.style.display = "block";					
					obj2.style.top= "270px";
					obj3.style.top= "295px"; 							
				}				
			}
			
		</script>
	</body>

</html>